class DituExample extends egret.DisplayObjectContainer {

    public constructor() {
        super();
        var url: string = "resource/ditu.tmx";
        var urlLoader: egret.URLLoader = new egret.URLLoader();
        urlLoader.dataFormat = egret.URLLoaderDataFormat.TEXT;
        //load complete
        urlLoader.addEventListener(egret.Event.COMPLETE, this.function1, url);

        urlLoader.load(new egret.URLRequest(url));
        //this.removeEventListener(egret.Event.ENTER_FRAME, this.function1, url);
    }
    public function1(event: egret.Event): void {
        var self = this;
        var url: string = "resource/ditu.tmx";
        var data: any = egret.XML.parse(event.target.data);
        var tmxTileMap: tiled.TMXTilemap = new tiled.TMXTilemap(2000, 2000, data, url);
        tmxTileMap.x = 200;
        tmxTileMap.render();//
        //     var arr: any = tmxTileMap.getObjects();
        //     //得到当前层级对象info
        //     var objData: any = arr[0]._childrens[0];
        //     //得到当前对象
        //     var currentObj: egret.DisplayObject = objData.attributes
        //    // this.current = currentObj;
        //      document.addEventListener("keypress", e => {
        //         if (e.key == "w")
        //         { currentObj.y -= 200; }
        //     })        
        self.addChild(tmxTileMap);
    }

}


